<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class News_model extends CI_Model {

	function getAll()
	{
		$this->db->select("news.id as id, username, title, content, time_created, news.status");
		$this->db->join('users', 'users.id = news.user_id');
		return $this->db->get('news');
	}

	function get_by_id($id)
	{
		$this->db->where('id',$id);
		return $this->db->get('news');
	}

}

/* End of file news_model.php */
/* Location: ./application/models/news_model.php */